<template>
  <div class="">
    
    <el-row type="flex"  justify="center" class="index-title">
        
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="toMenu">
          <el-menu-item index="1">首页</el-menu-item>
          <!-- <el-submenu index="2">
            <template slot="title">组件使用</template>
            <el-menu-item index="2-1">选项1</el-menu-item>
            <el-menu-item index="2-2">选项2</el-menu-item>
            <el-menu-item index="2-3">选项3</el-menu-item>
              
          </el-submenu> -->
          <el-menu-item index="2" path='123'>常用API</el-menu-item>
          <el-menu-item index="3" >组件使用</el-menu-item>
          <el-menu-item index="4" >组件开发</el-menu-item>
          <el-menu-item index="5" >模块总结</el-menu-item>
          <el-menu-item index="6" >学习模块</el-menu-item>
          <el-menu-item index="7" >工作常用</el-menu-item>
        </el-menu>
    </el-row>
  
    <el-row :gutter='20'>
        
        <el-col  >
            <router-view />
        </el-col>
    </el-row>
    
    
    
  </div>
</template>

<script>
export default {
  name: 'hzjmain',
  components: {
    
 
  },
  props: {
    msg: String
  },
  data() {
    return {
      codeShow:false,
      activeIndex: '1',
      index:'1'
    }
  },
  methods:{
      
      
      toMenu(key, keyPath){
        this.index =key
        debugger 
        if(key==1){
          this.$router.push('./')
        }else if(key==2){
          this.$router.push('./apiView')
        }else if(key==3){
          this.$router.push('./comView')
        }else if(key==4){
          this.$router.push('./comCreate')
        }else if(key==5){
          this.$router.push('./module')
        }else if(key==6){
          this.$router.push('./studyModule')
        }else if(key==7){
          this.$router.push('./workUse')
        }
       
      }

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
